package com.example.parkdemo.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.user.NewsParamItem
import com.example.base.user.UserBean
import com.example.parkdemo.R

class NewsAdapter : BaseQuickAdapter<NewsParamItem, BaseViewHolder>(R.layout.item_user) {
    override fun convert(holder: BaseViewHolder, item: NewsParamItem) {
        holder.setText(R.id.item_news_title_tv, item.newsTitle)
        holder.setText(R.id.item_news_value_tv, item.newsValue)
        holder.setText(R.id.item_news_time_tv, item.newsTime)
        holder.setText(R.id.item_news_tag_tv, item.tagId.toString())
        when (item.tagId) {
            0 -> holder.setText(R.id.item_news_tag_tv, "物业新闻")
            1 -> holder.setText(R.id.item_news_tag_tv, "娱乐新闻")
            2 -> holder.setText(R.id.item_news_tag_tv, "体育新闻")
            3 -> holder.setText(R.id.item_news_tag_tv, "社会新闻")
            4 -> holder.setText(R.id.item_news_tag_tv, "早间新闻")
        }
    }
}